package com.gujiangbo.oom;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2022/3/12 16:26
 * @Version: 1.0
 * @Description: 栈溢出错误
 */
public class StackOverFlowErrorDemo {

    private static AtomicInteger atomicInteger = new AtomicInteger();

    public static void main(String[] args) {
        try {
            stackoverflowerror();
        } catch (Exception ignored) {

        } finally {
            System.out.println(atomicInteger.get());
        }
    }

    private static void stackoverflowerror() {
        atomicInteger.incrementAndGet();
        stackoverflowerror();
    }
}
